\(\int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx\) [561]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 176 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {3 \left (2 a^2+b^2\right ) \text {arcsinh}(\tan (c+d x)) \sec (c+d x)}{2 b^4 d \sqrt {\sec ^2(c+d x)}}+\frac {3 a \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \sec (c+d x)}{b^4 d \sqrt {\sec ^2(c+d x)}}-\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))} \]

[Out]

3/2*(2*a^2+b^2)*arcsinh(tan(d*x+c))*sec(d*x+c)/b^4/d/(sec(d*x+c)^2)^(1/2)+3*a*arctanh((b-a*tan(d*x+c))/(a^2+b^
2)^(1/2)/(sec(d*x+c)^2)^(1/2))*sec(d*x+c)*(a^2+b^2)^(1/2)/b^4/d/(sec(d*x+c)^2)^(1/2)-3/2*sec(d*x+c)*(2*a-b*tan
(d*x+c))/b^3/d-sec(d*x+c)^3/b/d/(a+b*tan(d*x+c))

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3593, 747, 829, 858, 221, 739, 212} \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {3 \left (2 a^2+b^2\right ) \sec (c+d x) \text {arcsinh}(\tan (c+d x))}{2 b^4 d \sqrt {\sec ^2(c+d x)}}+\frac {3 a \sqrt {a^2+b^2} \sec (c+d x) \text {arctanh}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right )}{b^4 d \sqrt {\sec ^2(c+d x)}}-\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))} \]

[In]

Int[Sec[c + d*x]^5/(a + b*Tan[c + d*x])^2,x]

[Out]

(3*(2*a^2 + b^2)*ArcSinh[Tan[c + d*x]]*Sec[c + d*x])/(2*b^4*d*Sqrt[Sec[c + d*x]^2]) + (3*a*Sqrt[a^2 + b^2]*Arc
Tanh[(b - a*Tan[c + d*x])/(Sqrt[a^2 + b^2]*Sqrt[Sec[c + d*x]^2])]*Sec[c + d*x])/(b^4*d*Sqrt[Sec[c + d*x]^2]) -
 (3*Sec[c + d*x]*(2*a - b*Tan[c + d*x]))/(2*b^3*d) - Sec[c + d*x]^3/(b*d*(a + b*Tan[c + d*x]))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 739

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 747

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(d + e*x)^(m + 1)*((a + c*x^2)^p/(e
*(m + 1))), x] - Dist[2*c*(p/(e*(m + 1))), Int[x*(d + e*x)^(m + 1)*(a + c*x^2)^(p - 1), x], x] /; FreeQ[{a, c,
 d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] || LtQ[m, -1]) && NeQ[m, -1] &&  !ILtQ[m +
 2*p + 1, 0] && IntQuadraticQ[a, 0, c, d, e, m, p, x]

Rule 829

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(d + e*x)^(m
 + 1)*(c*e*f*(m + 2*p + 2) - g*c*d*(2*p + 1) + g*c*e*(m + 2*p + 1)*x)*((a + c*x^2)^p/(c*e^2*(m + 2*p + 1)*(m +
 2*p + 2))), x] + Dist[2*(p/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2))), Int[(d + e*x)^m*(a + c*x^2)^(p - 1)*Simp[f*a
*c*e^2*(m + 2*p + 2) + a*c*d*e*g*m - (c^2*f*d*e*(m + 2*p + 2) - g*(c^2*d^2*(2*p + 1) + a*c*e^2*(m + 2*p + 1)))
*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] ||  !R
ationalQ[m] || (GeQ[m, -1] && LtQ[m, 0])) &&  !ILtQ[m + 2*p, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*
m, 2*p])

Rule 858

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 3593

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[d^(2*
IntPart[m/2])*((d*Sec[e + f*x])^(2*FracPart[m/2])/(b*f*(Sec[e + f*x]^2)^FracPart[m/2])), Subst[Int[(a + x)^n*(
1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&
 !IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\sec (c+d x) \text {Subst}\left (\int \frac {\left (1+\frac {x^2}{b^2}\right )^{3/2}}{(a+x)^2} \, dx,x,b \tan (c+d x)\right )}{b d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))}+\frac {(3 \sec (c+d x)) \text {Subst}\left (\int \frac {x \sqrt {1+\frac {x^2}{b^2}}}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^3 d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))}+\frac {(3 \sec (c+d x)) \text {Subst}\left (\int \frac {-\frac {a}{b^2}+\frac {\left (2 a^2+b^2\right ) x}{b^4}}{(a+x) \sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{2 b d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))}-\frac {\left (3 a \left (a^2+b^2\right ) \sec (c+d x)\right ) \text {Subst}\left (\int \frac {1}{(a+x) \sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b^5 d \sqrt {\sec ^2(c+d x)}}+\frac {\left (3 \left (2 a^2+b^2\right ) \sec (c+d x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{2 b^5 d \sqrt {\sec ^2(c+d x)}} \\ & = \frac {3 \left (2 a^2+b^2\right ) \text {arcsinh}(\tan (c+d x)) \sec (c+d x)}{2 b^4 d \sqrt {\sec ^2(c+d x)}}-\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))}+\frac {\left (3 a \left (a^2+b^2\right ) \sec (c+d x)\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a^2}{b^2}-x^2} \, dx,x,\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\sec ^2(c+d x)}}\right )}{b^5 d \sqrt {\sec ^2(c+d x)}} \\ & = \frac {3 \left (2 a^2+b^2\right ) \text {arcsinh}(\tan (c+d x)) \sec (c+d x)}{2 b^4 d \sqrt {\sec ^2(c+d x)}}+\frac {3 a \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b \left (1-\frac {a \tan (c+d x)}{b}\right )}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \sec (c+d x)}{b^4 d \sqrt {\sec ^2(c+d x)}}-\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 6.58 (sec) , antiderivative size = 709, normalized size of antiderivative = 4.03 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {(a-i b) (a+i b) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))}{b^3 d (a+b \tan (c+d x))^2}-\frac {2 a \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d (a+b \tan (c+d x))^2}-\frac {6 a \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a^2+b^2} \left (-b \cos \left (\frac {1}{2} (c+d x)\right )+a \sin \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 \cos \left (\frac {1}{2} (c+d x)\right )+b^2 \cos \left (\frac {1}{2} (c+d x)\right )}\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{b^4 d (a+b \tan (c+d x))^2}-\frac {3 \left (2 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{2 b^4 d (a+b \tan (c+d x))^2}+\frac {3 \left (2 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{2 b^4 d (a+b \tan (c+d x))^2}+\frac {\sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2 (a+b \tan (c+d x))^2}-\frac {2 a \sec ^2(c+d x) \sin \left (\frac {1}{2} (c+d x)\right ) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \tan (c+d x))^2}-\frac {\sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2 (a+b \tan (c+d x))^2}+\frac {2 a \sec ^2(c+d x) \sin \left (\frac {1}{2} (c+d x)\right ) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \tan (c+d x))^2} \]

[In]

Integrate[Sec[c + d*x]^5/(a + b*Tan[c + d*x])^2,x]

[Out]

-(((a - I*b)*(a + I*b)*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x]))/(b^3*d*(a + b*Tan[c + d*x])^2)) - (2*
a*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(b^3*d*(a + b*Tan[c + d*x])^2) - (6*a*Sqrt[a^2 + b^2]*Ar
cTanh[(Sqrt[a^2 + b^2]*(-(b*Cos[(c + d*x)/2]) + a*Sin[(c + d*x)/2]))/(a^2*Cos[(c + d*x)/2] + b^2*Cos[(c + d*x)
/2])]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(b^4*d*(a + b*Tan[c + d*x])^2) - (3*(2*a^2 + b^2)*Lo
g[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(2*b^4*d*(a + b*Tan
[c + d*x])^2) + (3*(2*a^2 + b^2)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*S
in[c + d*x])^2)/(2*b^4*d*(a + b*Tan[c + d*x])^2) + (Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(4*b^2
*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2*(a + b*Tan[c + d*x])^2) - (2*a*Sec[c + d*x]^2*Sin[(c + d*x)/2]*(a*C
os[c + d*x] + b*Sin[c + d*x])^2)/(b^3*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(a + b*Tan[c + d*x])^2) - (Sec[c
 + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(4*b^2*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2*(a + b*Tan[c +
 d*x])^2) + (2*a*Sec[c + d*x]^2*Sin[(c + d*x)/2]*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(b^3*d*(Cos[(c + d*x)/2]
 + Sin[(c + d*x)/2])*(a + b*Tan[c + d*x])^2)

Maple [A] (verified)

Time = 32.08 (sec) , antiderivative size = 259, normalized size of antiderivative = 1.47

method result size
derivativedivides \(\frac {\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-6 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}-\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (6 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {\frac {2 \left (\frac {\left (a^{2}+b^{2}\right ) b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \left (a^{2}+b^{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-6 a \sqrt {a^{2}+b^{2}}\, \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4}}}{d}\) \(259\)
default \(\frac {\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-6 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}-\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (6 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {\frac {2 \left (\frac {\left (a^{2}+b^{2}\right ) b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \left (a^{2}+b^{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-6 a \sqrt {a^{2}+b^{2}}\, \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4}}}{d}\) \(259\)
risch \(-\frac {-3 i a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2} \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+a \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +a \right ) d \,b^{3}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d \,b^{4}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d \,b^{2}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d \,b^{4}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d \,b^{2}}+\frac {3 \sqrt {a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{4}}-\frac {3 \sqrt {a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{4}}\) \(353\)

[In]

int(sec(d*x+c)^5/(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/2/b^2/(tan(1/2*d*x+1/2*c)-1)^2-1/2*(-4*a-b)/b^3/(tan(1/2*d*x+1/2*c)-1)+1/2/b^4*(-6*a^2-3*b^2)*ln(tan(1/
2*d*x+1/2*c)-1)-1/2/b^2/(tan(1/2*d*x+1/2*c)+1)^2-1/2*(4*a-b)/b^3/(tan(1/2*d*x+1/2*c)+1)+1/2/b^4*(6*a^2+3*b^2)*
ln(tan(1/2*d*x+1/2*c)+1)+2/b^4*(((a^2+b^2)*b^2/a*tan(1/2*d*x+1/2*c)+b*(a^2+b^2))/(tan(1/2*d*x+1/2*c)^2*a-2*b*t
an(1/2*d*x+1/2*c)-a)-3*a*(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 355 vs. \(2 (163) = 326\).

Time = 0.32 (sec) , antiderivative size = 355, normalized size of antiderivative = 2.02 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {6 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b^{3} + 6 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} - 6 \, {\left (a^{2} \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 3 \, {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{4 \, {\left (a b^{4} d \cos \left (d x + c\right )^{3} + b^{5} d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )}} \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/4*(6*a*b^2*cos(d*x + c)*sin(d*x + c) - 2*b^3 + 6*(2*a^2*b + b^3)*cos(d*x + c)^2 - 6*(a^2*cos(d*x + c)^3 + a
*b*cos(d*x + c)^2*sin(d*x + c))*sqrt(a^2 + b^2)*log((2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c
)^2 - 2*a^2 - b^2 - 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a
^2 - b^2)*cos(d*x + c)^2 + b^2)) - 3*((2*a^3 + a*b^2)*cos(d*x + c)^3 + (2*a^2*b + b^3)*cos(d*x + c)^2*sin(d*x
+ c))*log(sin(d*x + c) + 1) + 3*((2*a^3 + a*b^2)*cos(d*x + c)^3 + (2*a^2*b + b^3)*cos(d*x + c)^2*sin(d*x + c))
*log(-sin(d*x + c) + 1))/(a*b^4*d*cos(d*x + c)^3 + b^5*d*cos(d*x + c)^2*sin(d*x + c))

Sympy [F]

\[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\int \frac {\sec ^{5}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \]

[In]

integrate(sec(d*x+c)**5/(a+b*tan(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)**5/(a + b*tan(c + d*x))**2, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 471 vs. \(2 (163) = 326\).

Time = 0.33 (sec) , antiderivative size = 471, normalized size of antiderivative = 2.68 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {2 \, {\left (6 \, a^{3} + 2 \, a b^{2} + \frac {6 \, a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, {\left (2 \, a^{3} + a b^{2}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, {\left (3 \, a^{2} b + b^{3}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {{\left (3 \, a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{2} b^{3} + \frac {2 \, a b^{4} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, a^{2} b^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, a b^{4} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, a^{2} b^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {2 \, a b^{4} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {a^{2} b^{3} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {6 \, \sqrt {a^{2} + b^{2}} a \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{4}} - \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{4}} + \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{4}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(2*(6*a^3 + 2*a*b^2 + 6*a^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + (9*a^2*b + 2*b^3)*sin(d*x + c)/(cos(d*x
 + c) + 1) - 6*(2*a^3 + a*b^2)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 4*(3*a^2*b + b^3)*sin(d*x + c)^3/(cos(d*x
 + c) + 1)^3 + (3*a^2*b + 2*b^3)*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/(a^2*b^3 + 2*a*b^4*sin(d*x + c)/(cos(d*x
 + c) + 1) - 3*a^2*b^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 4*a*b^4*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 3*a
^2*b^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + 2*a*b^4*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - a^2*b^3*sin(d*x + c
)^6/(cos(d*x + c) + 1)^6) - 6*sqrt(a^2 + b^2)*a*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/
(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/b^4 - 3*(2*a^2 + b^2)*log(sin(d*x + c)/(cos(d*x + c
) + 1) + 1)/b^4 + 3*(2*a^2 + b^2)*log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/b^4)/d

Giac [A] (verification not implemented)

none

Time = 0.50 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.59 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{4}} - \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{4}} + \frac {6 \, {\left (a^{3} + a b^{2}\right )} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b^{4}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} b^{3}} + \frac {4 \, {\left (a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3} + a b^{2}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )} a b^{3}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(3*(2*a^2 + b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^4 - 3*(2*a^2 + b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1
))/b^4 + 6*(a^3 + a*b^2)*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2
*c) - 2*b + 2*sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*b^4) + 2*(b*tan(1/2*d*x + 1/2*c)^3 + 4*a*tan(1/2*d*x + 1/2*c)
^2 + b*tan(1/2*d*x + 1/2*c) - 4*a)/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*b^3) + 4*(a^2*b*tan(1/2*d*x + 1/2*c) + b^3*
tan(1/2*d*x + 1/2*c) + a^3 + a*b^2)/((a*tan(1/2*d*x + 1/2*c)^2 - 2*b*tan(1/2*d*x + 1/2*c) - a)*a*b^3))/d

Mupad [B] (verification not implemented)

Time = 5.94 (sec) , antiderivative size = 585, normalized size of antiderivative = 3.32 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\mathrm {atanh}\left (\frac {648\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{216\,a\,b^2+648\,a^3+\frac {432\,a^5}{b^2}}+\frac {432\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{432\,a^5+648\,a^3\,b^2+216\,a\,b^4}+\frac {216\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{216\,a+\frac {648\,a^3}{b^2}+\frac {432\,a^5}{b^4}}\right )\,\left (6\,a^2+3\,b^2\right )}{b^4\,d}-\frac {\frac {2\,\left (3\,a^2+b^2\right )}{b^3}+\frac {6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{b^3}-\frac {6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+b^2\right )}{b^3}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a^2+2\,b^2\right )}{a\,b^2}-\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,a^2+b^2\right )}{a\,b^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (3\,a^2+2\,b^2\right )}{a\,b^2}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {6\,a\,\mathrm {atanh}\left (\frac {432\,a^3\,\sqrt {a^2+b^2}}{432\,a^3\,b+\frac {432\,a^5}{b}+864\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+864\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {864\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{432\,a^3+\frac {432\,a^5}{b^2}+864\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {864\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {432\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{432\,a^5+864\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b+432\,a^3\,b^2+864\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^3}\right )\,\sqrt {a^2+b^2}}{b^4\,d} \]

[In]

int(1/(cos(c + d*x)^5*(a + b*tan(c + d*x))^2),x)

[Out]

(atanh((648*a^3*tan(c/2 + (d*x)/2))/(216*a*b^2 + 648*a^3 + (432*a^5)/b^2) + (432*a^5*tan(c/2 + (d*x)/2))/(216*
a*b^4 + 432*a^5 + 648*a^3*b^2) + (216*a*tan(c/2 + (d*x)/2))/(216*a + (648*a^3)/b^2 + (432*a^5)/b^4))*(6*a^2 +
3*b^2))/(b^4*d) - ((2*(3*a^2 + b^2))/b^3 + (6*a^2*tan(c/2 + (d*x)/2)^4)/b^3 - (6*tan(c/2 + (d*x)/2)^2*(2*a^2 +
 b^2))/b^3 + (tan(c/2 + (d*x)/2)*(9*a^2 + 2*b^2))/(a*b^2) - (4*tan(c/2 + (d*x)/2)^3*(3*a^2 + b^2))/(a*b^2) + (
tan(c/2 + (d*x)/2)^5*(3*a^2 + 2*b^2))/(a*b^2))/(d*(a + 2*b*tan(c/2 + (d*x)/2) - 3*a*tan(c/2 + (d*x)/2)^2 + 3*a
*tan(c/2 + (d*x)/2)^4 - a*tan(c/2 + (d*x)/2)^6 - 4*b*tan(c/2 + (d*x)/2)^3 + 2*b*tan(c/2 + (d*x)/2)^5)) - (6*a*
atanh((432*a^3*(a^2 + b^2)^(1/2))/(432*a^3*b + (432*a^5)/b + 864*a^4*tan(c/2 + (d*x)/2) + 864*a^2*b^2*tan(c/2
+ (d*x)/2)) + (864*a^2*tan(c/2 + (d*x)/2)*(a^2 + b^2)^(1/2))/(432*a^3 + (432*a^5)/b^2 + 864*a^2*b*tan(c/2 + (d
*x)/2) + (864*a^4*tan(c/2 + (d*x)/2))/b) + (432*a^4*tan(c/2 + (d*x)/2)*(a^2 + b^2)^(1/2))/(432*a^5 + 432*a^3*b
^2 + 864*a^4*b*tan(c/2 + (d*x)/2) + 864*a^2*b^3*tan(c/2 + (d*x)/2)))*(a^2 + b^2)^(1/2))/(b^4*d)